Chart B
rest_inspec %>%
mutate(street = fct_reorder(street, score)) %>%
plot_ly(y = ~score, color = ~street, type = "box", colors = "viridis")
Chart C
density_ggplot =
rest_inspec %>%
select(boro,street ,inspection_type,building,score) %>%
drop_na() %>%
filter(
boro== "MANHATTAN",
inspection_type == "Cycle Inspection / Initial Inspection",
score %in% 35:45,
building %in% 0:2000
) %>%
filter(
street %in% c(
"10 AVENUE",
"7 AVENUE",
"8 AVENUE",
"WEST 35 STREET",
"W 32ND ST",
"BROADWAY",
"west 34th st",
"5 AVENUE",
"7 AVENUE",
"8TH AVE",
"9 AVENUE"
)) %>%
ggplot(aes(x = street, fill = building ),colors = "viridis") +
geom_density(alpha = 0.25)
ggplotly(density_ggplot)